package com.faxsun.web.endpoint.entity;

import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import mblog.core.pojos.Comment;

public class LiveCommentJSON implements Serializable{
   
    private static final long serialVersionUID = 1057260715242961204L;
    
    private Map<String, Object> comments_blacklist;  
    
    public static final String COMMENTS= "comments"; 
    public static final String BLACKLIST= "blacklist"; 
    public static final String ADMIN= "adminID";  
    public static final String MGRLIST= "managerlist";  
    public static final String LIVEMSGS= "livemsgs"; 
    
    @SuppressWarnings("unchecked")
	public LiveCommentJSON(List<Comment> comments, List<Long> blacklist, List<Long> mgrList, Map<String, LiveMsgJSON> livemsgs, Long admin){
        comments_blacklist = new HashMap<String, Object>();
        
        List<Comment> commentsRet = comments == null? Collections.EMPTY_LIST : comments;
        List<Long> blacklistRet = blacklist == null? Collections.EMPTY_LIST : blacklist;
        List<Long> mgrListRet = mgrList == null? Collections.EMPTY_LIST : mgrList;        
        Map<String, LiveMsgJSON> comments_livemsg = livemsgs == null? Collections.EMPTY_MAP : livemsgs;
        
        comments_blacklist.put(ADMIN, admin == null? -1 : admin);  
        
        comments_blacklist.put(COMMENTS, commentsRet);        
        comments_blacklist.put(BLACKLIST, blacklistRet);            
        comments_blacklist.put(MGRLIST, mgrListRet);       
        comments_blacklist.put(LIVEMSGS, comments_livemsg);       
    }

    public Map<String, Object> getComments_blacklist() {
        return comments_blacklist;
    }

    public void setComments_blacklist(Map<String, Object> comments_blacklist) {
        this.comments_blacklist = comments_blacklist;
    }
    
}
